using System;
using System.Text;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using RealState.BusinessObjects;
using RealState.DAL;

namespace RealState.BLL
{
	public class CategoriesBLL
	{
		private CategoriesDAO _CategoriesDAO;

		public CategoriesDAO CategoriesDAO
		{
			get { return _CategoriesDAO; }
			set { _CategoriesDAO = value; }
		}

		public CategoriesBLL()
		{
			CategoriesDAO = new CategoriesDAO();
		}
		public List<Categories> GetCategoriess()
		{
			try
			{
				return CategoriesDAO.GetCategoriess();
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}

        public List<Categories> GetCategoriesType(int type)
        {
            try
            {
                return CategoriesDAO.GetCategoriesType(type);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

		public Categories GetCategories(int Id)
		{
			try
			{
				return CategoriesDAO.GetCategories(Id);
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public int AddCategories(Categories oCategories)
		{
			try
			{
				return CategoriesDAO.AddCategories(oCategories);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateCategories(Categories oCategories)
		{
			try
			{
				return CategoriesDAO.UpdateCategories(oCategories);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveCategories(Categories oCategories)
		{
			try
			{
				return CategoriesDAO.RemoveCategories(oCategories);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveCategories(int Id)
		{
			try
			{
				return CategoriesDAO.RemoveCategories(Id);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public List<Categories> DeserializeCategoriess(string Path)
		{
			try
			{
				return GenericXmlSerializer<List<Categories>>.Deserialize(Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public void SerializeCategoriess(string Path, List<Categories> Categoriess)
		{
			try
			{
				GenericXmlSerializer<List<Categories>>.Serialize(Categoriess, Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
	}
}
